-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor Array subhints fix #32871
Editor Array subhints fix #32871
Conversation
Thanks for the contribution. You need to squash the commits together (as described in http://docs.godotengine.org/en/latest/community/contributing/pr_workflow.html#mastering-the-pr-workflow-the-rebase). |
…g syntax). F.e restrict Array's editor UI to allow only NodePaths of RigidBody type. I think hint_string syntax was supposed to be: (VARIANT_ID_INT):[(HINT_ID_INT)/(HINT_STRING)] the section after colon is optional but it's hard to figure out without any docs, and broken string parser. Use Example: ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "hints_array", PROPERTY_HINT_NONE, itos(Variant::NODE_PATH)+":"+itos(PROPERTY_HINT_NODE_PATH_VALID_TYPES)+"/RigidBody"), "set_hints", "get_hints");
409f189
to
f224740
Compare
Sure - no problem. Just squashed my commits. |
For the reference, so far there seems to be only three uses of this undocumented feature:
The syntax is quite non-obvious. It was implemented by @bojidar-bg in #6930, fixing #3586. Are you sure that those changes don't break the GDScript export hints? |
Thank you for looking into it. So I did check use-cases you have mentioned - and my fix crashes editor for one of them (resource hint), and doesn't fix every other case (sub-property hint). I think we need to step back and re-think it a bit - since we have more than one format here. Summary:
master: sub-hint not working
master: works as expected
master: sub-hint not working I need to look into it more - colon is used in more than one context. It seems, the first colon is hint/sub-hint separator - and any following colon is property descriptor - but I can't confirm this easily.
master: can't add any element to this array via editor
master: works as expected
The slash left of colon is probably what original code expected. If I understand this correctly - we can have sub-types left of the colon sign so: Could you confirm this? Still I think this case can be fixed fairly easily. |
Hey, sorry for the late comment. Looking at what I implemented in GDScript and what the previous code was, seems like the format is: While the examples given the above comment (and the new code) expect: Now, in general, the first option should be better since we already require that the colon is there, but the "/" can be ambiguous in the second case (and thus, if the sub_hint_string includes a slash, you would need to add "0/" before it) |
@lonegamedev Is this still desired? If so, it needs to be rebased on the latest master branch. |
Closing as this is stale. This use case is likely better handled in 4.0 using typed arrays, but this can be reopened if there is still a need for what it implemented. |
F.e restrict Array's editor UI to allow only NodePaths of RigidBody type.
I think hint_string syntax was supposed to be:
(VARIANT_ID_INT):[(HINT_ID_INT)/(HINT_STRING)]
the section after colon is optional
but it's hard to figure out without any docs,
and broken string parser.
Use Example:
ADD_PROPERTY(PropertyInfo(Variant::ARRAY,
"hints_array", PROPERTY_HINT_NONE,
itos(Variant::NODE_PATH)+":"+itos(PROPERTY_HINT_NODE_PATH_VALID_TYPES)+"/RigidBody"),
"set_hints", "get_hints");